// test code for contrast stretching

#include "Image.h"
#include "Dip.h"
#include <iostream>
#include <cstdlib>
using namespace std;

#define Usage "testcs inimg outimg slope intercept\n"

int main(int argc, char **argv)
{
  Image inimg, outimg;    // the original image 
  float m, b;

  // check if the number of arguments on the command line is correct
  if (argc < 5) {
    cout << Usage;
    exit(3);
  }

  // read in command-line arguments
  m = atoi(argv[3]);
  b = atoi(argv[4]);

  // read in image
  inimg = readImage(argv[1]);

  // test the contrast stretching function
  outimg = cs(inimg, m, b);

  // output the image
  writeImage(outimg, argv[2]);

  return 0;
}
